#include "stdafx.h"
#include "%Class%Tool.h"

USING_NAMESPACE_BENTLEY_SQLITE
USING_NAMESPACE_BENTLEY_SQLITE_EC
USING_NAMESPACE_EC
USING_NAMESPACE_BENTLEY_DGNPLATFORM
USING_NAMESPACE_BENTLEY_MOBILEDGN
USING_NAMESPACE_PBBIM_CORE
USING_NAMESPACE_PBBIM_COREMODEL
USING_NAMESPACE_PBBIM
USING_NAMESPACE_PBBIM_DIM

/*---------------------------------------------------------------------------------**//**
* @bsimethod                                    Y.Dong                       %CreateTime%
+---------------+---------------+---------------+---------------+---------------+------*/
%Class%Tool::%Class%Tool()
{
    TOOLSETTING_OPEN;
}

/*---------------------------------------------------------------------------------**//**
* @bsimethod                                    Y.Dong                       %CreateTime%
+---------------+---------------+---------------+---------------+---------------+------*/
%Class%Tool::~%Class%Tool()
{
    TOOLSETTING_CLOSE;
}

/*---------------------------------------------------------------------------------**//**
* @bsimethod                                    Y.Dong                       %CreateTime%
+---------------+---------------+---------------+---------------+---------------+------*/
void %Class%Tool::_OnRestartTool()
{
    %Class%Tool* newTool = new %Class%Tool();
    newTool->InstallTool();
}

/*---------------------------------------------------------------------------------**//**
* @bsimethod                                    Y.Dong                       %CreateTime%
+---------------+---------------+---------------+---------------+---------------+------*/
bool %Class%Tool::_OnPlaceObjectByOutLet(DgnProjectR project)
{
    PBStoreyPtr ptrStorey = PBArchiStoreyManager::Get().GetCurrentStorey();
    if (!ptrStorey.IsValid())
        return false;

    //int npt = m_points.size();

    //PBArchSlabElement Slab;
    //for (SIZE_T i = 0; i < npt - 1; i++)
    //{
    //    DSegment3d segment;
    //    segment.Init(m_points[i], m_points[i + 1]);
    //    ICurvePrimitivePtr line = ICurvePrimitive::CreateLine(segment);
    //    Slab.AddProfileCurve(*line);
    //}

    //Slab.SetDirect(DVec3d::From(0, 0, -200));

    //if (ptrStorey != NULL)
    //{
    //    Slab.AddToProject(project, *ptrStorey);
    //}

    return true;
}
